<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%-- 
    Document   : index
    Created on : 04-13-2013, 08:53:46 PM
    Author     : javaee
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<jsp:useBean id="now" class="java.util.Date" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.:Bienvenido al Sistema:.</title>
        <script>


            function validarLogin(form1)
            {
                var user = document.forms[form1].elements['usuario'].value;
                var clave = document.forms[form1].elements['clave'].value;
                if (user !== null && user !== '' && clave !== null && clave !== '') {
                    return true;
                } else {

                    alert('El Usuario y la clave son requeridos!!!');
                    return false;
                }     
            }
        </script>
    </head>
    <body style="background-image:url('img/bg.jpg');color:white;">
        <h3>Digite sus credenciales para ingresar al Sistema</h3>
        <h3>*credenciales: <b><u>demo</u></b></h3>
        
        <ul style="color: yellow">
            <c:if test="${not empty errores}">
                <c:forEach items="${errores}" var="error">
                    <li>${error}</li>
            </c:forEach>
            <c:remove scope="session" var="errores"/>
            </c:if>
        </ul>
        <form name="form1" method="POST" action="${pageContext.servletContext.contextPath}/login.ufg" onSubmit="validarLogin('form1')">
            <table border="1" style="border-collapse:collapse">
                
                <tbody>
                    <tr>
                        <td>Usuario</td>
                        <td><input type="text" name="usuario" value="" /></td>
                    </tr>
                    <tr>
                        <td>Clave</td>
                        <td><input type="password" name="clave" value="" /></td>
                    </tr>
                    <tr>
                        <td><input type="reset" value="limpiar" /></td>
                        <td><input type="submit" value="Enviar" /></td>
                    </tr>
                </tbody>
            </table>

        </form><br><br><br>
        <ul>
            <li>Saul Roberto Flamenco Martinez- FM101313</li>
            <li>James Edward Humberstone Morales - HM100113</li>
        </ul>
        <fmt:formatDate value="${now}" dateStyle="full" />
           
    </body>
</html>
